import java.io.*;
    
public class CharReader {
  // Our data members
  private FileReader in;     // File descriptor
  
  /**
   * Give the name of the input file as a String.
   *
   */
  /**
   * Default constructor.  Creates and initializes the 
   * CharReader to read input from the file named in
   *
   * @param in the filename to read
   */
  public CharReader( String in ) {
    super();
    try {
      File inputFile = new File( in );
      this.in = new FileReader( inputFile );
    } catch ( IOException e ) {
      System.out.println( "I/O error in constructor" );
    }
  }
  
  /**
   * Starting from the beginning of the file, this method will return the
   * next character in the file as an integer.
   *
   * @return the ASCII value of the character read.
   */
  public int readNextChar() throws IOException
  {
    int ch = -1;
      ch = in.read();           
    return ( ch );
  }
  
  /**
   * Closes the file being read.
   *
   */
  public void closeFile(){
    try {
      in.close();
    } catch ( IOException e ) {
      System.out.println( "I/O error in closing" );
    }
  }
  

}